<html><head>
<title>Apache Keep-Alive Support</title>
</head><body>

<!--#include virtual="header.html" -->
<h1>Apache Keep-Alive Support</h1>

<hr>

<h2>What is Keep-Alive?</h2>

The Keep-Alive extension to HTTP, as defined by the
<code>HTTP/1.1</code> draft, allows persistent connections. These
long-lived HTTP sessions allow multiple requests to be send over the
same TCP connection, and in some cases have been shown to result in an
almost 50% speedup in latency times for HTML documents with lots of
images.

<h2>Enabling Keep-Alive Support</h2>

Apache 1.1 comes with Keep-Alive support on by default, however there
are some directives you can use to modify Apache's behavior:

<h3>KeepAlive</h3>
<strong>Syntax:</strong> KeepAlive <em>max-requests</em><br>
<strong>Default:</strong> <code>KeepAlive 5</code><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Core<p>

This directive enables Keep-Alive support. Set <em>max-requests</em>
to the maximum number of requests you want Apache to entertain per
connection. A limit is imposed to prevent a client from hogging your
server resources. Set this to <code>0</code> to disable support.

<h3>KeepAliveTimeout</h3>
<strong>Syntax:</strong> KeepAliveTimeout <em>seconds</em><br>
<strong>Default:</strong> <code>KeepAliveTimeout 15</code><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Core<p>

The number of seconds Apache will wait for a subsequent request before
closing the connection. Once a request has been received, the timeout
value specified by the <a
href="../core.html#timeout"><code>Timeout</code></a> directive
applies.

<h2>When Keep-Alive Is Used</h2>

In order for Keep-Alive support to be used, first the browser must
support it. Many current browsers, including Netscape Navigator 2.0,
and Spyglass Mosaic-based browsers (including Microsoft Internet
Explorer) do. Note, however, that some Windows 95-based browsers misbehave
with Keep-Alive-supporting servers; they may occasionally hang on a
connect. This has been observed with several Windows browsers, and occurs
when connecting to any Keep-Alive server, not just Apache. Netscape 3.0b5
and later versions are known to work around this problem.

<p>However, Keep-Alive support only is active with files where the
length is known beforehand. This means that most CGI scripts,
server-side included files and directory listings will not use
the Keep-Alive protocol. While this should be completely transparent
to the end user, it is something the web-master may want to keep in mind.</p>

<!--#include virtual="footer.html" -->
</BODY>
</HTML>

